<?php


namespace app\erp\model;


use think\Model;

class MemberLogdb extends Model
{
    protected $pk = 'id';
    protected $name = 'member_log';

    public $param = [];

    public function getLoginTimeAttr($value){
        return date('Y-m-d H:i:s',$value);
    }

    public function base($query){
        if(isset($this->param['username']) && $this->param['username']){
            $query->whereLike('username','%'.$this->param['username'].'%');
        }
        if(isset($this->param['login_sys']) && $this->param['login_sys']){
            $query->whereLike('login_sys','%'.$this->param['login_sys'].'%');
        }
    }
}